package com.yuyou.fn.settlement.service;

import com.alibaba.fastjson.JSONObject;
import com.yuyou.fn.settlement.entity.PosPayRecord;

import java.util.function.Function;

public interface IPosPayService {

    void savePayRecord(PosPayRecord posPayRecord);

    PosPayRecord findPayRecord(Long requestPayId);

    boolean updateStatus(Long requestPayId , PosPayRecord.STATUS oldStatus , PosPayRecord.STATUS newStatus );

    boolean isPayingForOrder(Long busOrderId);

    void successPay(Long requestPayId , JSONObject posInfo, Function<PosPayRecord, Boolean> callback);

    boolean isSuccessPay(Long requestPayId);

    boolean isLockBalance(Long busOrderId);

    /**
     * 撤销已扫码记录
     * @param busOrderId
     */
    void cancel(Long busOrderId);

}
